From 20e46ce8aeef856efe020118cce8794249485f65 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 28 Oct 2015 10:14:54 -0400 Subject: [PATCH] shortcuts: Redo the stack switcher theming Use style classes on the button instead of the stack switcher, this makes it easier to reuse elsewhere. --- gtk/gtkshortcutssection.c | 3 ++- gtk/theme/Adwaita/_common.scss | 4 ++-- gtk/theme/Adwaita/gtk-contained-dark.css | 10 ++++------ gtk/theme/Adwaita/gtk-contained.css | 10 ++++------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index 538ddae516..9d8de020de 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -354,7 +354,7 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self) "spacing", 12, "no-show-all", TRUE, NULL); - gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self->switcher)), "round"); + gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (self->switcher)), GTK_STYLE_CLASS_LINKED); self->show_all = gtk_button_new_with_mnemonic (_("_Show All")); @@ -501,6 +501,7 @@ adjust_page_buttons (GtkWidget *widget, * much font size specific. */ gtk_widget_set_size_request (widget, 34, 34); + gtk_style_context_add_class (gtk_widget_get_style_context (widget), "circular"); label = gtk_bin_get_child (GTK_BIN (widget)); gtk_label_set_use_underline (GTK_LABEL (label), TRUE); diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index 45916e67eb..edd303e686 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -3438,12 +3438,12 @@ decoration { } } -shortcutswindow .round .button { +.button.circular { border-radius: 20px; outline-radius: 20px; } -shortcutswindow .round .button label { +.button.circular label { padding: 0; } diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css index 89e913daae..5a7e15d21f 100644 --- a/gtk/theme/Adwaita/gtk-contained-dark.css +++ b/gtk/theme/Adwaita/gtk-contained-dark.css @@ -4649,15 +4649,13 @@ decoration { background-origin: content-box; background-position: right center; } -shortcutswindow .round .button, shortcutswindow .round .header-bar .button.titlebutton, .header-bar shortcutswindow .round .button.titlebutton, -shortcutswindow .round .titlebar .button.titlebutton, -.titlebar shortcutswindow .round .button.titlebutton { +.button.circular, .header-bar .circular.button.titlebutton, +.titlebar .circular.button.titlebutton { border-radius: 20px; outline-radius: 20px; } -shortcutswindow .round .button label, shortcutswindow .round .header-bar .button.titlebutton label, .header-bar shortcutswindow .round .button.titlebutton label, -shortcutswindow .round .titlebar .button.titlebutton label, -.titlebar shortcutswindow .round .button.titlebutton label { +.button.circular label, .header-bar .circular.button.titlebutton label, +.titlebar .circular.button.titlebutton label { padding: 0; } .frame.keycap { diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css index c47800718f..154015391b 100644 --- a/gtk/theme/Adwaita/gtk-contained.css +++ b/gtk/theme/Adwaita/gtk-contained.css @@ -4822,15 +4822,13 @@ decoration { background-origin: content-box; background-position: right center; } -shortcutswindow .round .button, shortcutswindow .round .header-bar .button.titlebutton, .header-bar shortcutswindow .round .button.titlebutton, -shortcutswindow .round .titlebar .button.titlebutton, -.titlebar shortcutswindow .round .button.titlebutton { +.button.circular, .header-bar .circular.button.titlebutton, +.titlebar .circular.button.titlebutton { border-radius: 20px; outline-radius: 20px; } -shortcutswindow .round .button label, shortcutswindow .round .header-bar .button.titlebutton label, .header-bar shortcutswindow .round .button.titlebutton label, -shortcutswindow .round .titlebar .button.titlebutton label, -.titlebar shortcutswindow .round .button.titlebutton label { +.button.circular label, .header-bar .circular.button.titlebutton label, +.titlebar .circular.button.titlebutton label { padding: 0; } .frame.keycap { -- 2.30.2